import request from '@/utils/request'
import qs from 'qs'

export function configAllEmp2() {
  return request({
    url: '/orgConfig/configAllEmp2',
    method: 'post',
  })
}

export function getPolicy() {
  return request({
    url: '/orgConfig/getPolicy',
    method: 'post',
  })
}

export function updateUser(data) {
  return request({
    url: '/orgConfig/updateUser',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerUserInsert(data) {
  return request({
    url: '/center/centerUserInsert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerUserDelete(data) {
  return request({
    url: '/center/centerUserDelete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerSportInsert(data) {
  return request({
    url: '/center/centerSportInsert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerSportDelete(data) {
  return request({
    url: '/center/centerSportDelete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function sport_by_org(data) {
  return request({
    url: '/meta/sport/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerSportSelect(data) {
  return request({
    url: '/center/centerSportSelect',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerInsert(data) {
  return request({
    url: '/center/centerInsert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerUpdate(data) {
  return request({
    url: '/center/centerUpdate',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function centerDelete(data) {
  return request({
    url: '/center/centerDelete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function config(data) {
  return request({
    url: '/center/config',
    method: 'post',
  })
}

export function orgBaseInfoCurrent(data) {
  return request({
    url: '/organization/base_info/current',
    method: 'post',
  })
}

export function orgHonorAll(data) {
  return request({
    url: '/data/org_honor/json/all',
    method: 'post',
  })
}

export function orgNameAll(data) {
  return request({
    url: '/data/org_name/json/all',
    method: 'post',
  })
}

export function orgHonorInsert(data) {
  return request({
    url: '/data/org_honor/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgHonorUpdate(data) {
  return request({
    url: '/data/org_honor/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgHonorDelete(data) {
  return request({
    url: '/data/org_honor/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgNamesInsert(data) {
  return request({
    url: '/data/org_name/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgNamesUpdate(data) {
  return request({
    url: '/data/org_name/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgNamesDelete(data) {
  return request({
    url: '/data/org_name/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function adminLevelAll(data) {
  return request({
    url: '/data/admin_level/json/all',
    method: 'post',
  })
}

export function org_manage_admin_type(data) {
  return request({
    url: '/data/org_manage_admin_type/json/all',
    method: 'post',
  })
}

export function org_dependence(data) {
  return request({
    url: '/data/org_dependence/json/all',
    method: 'post',
  })
}

export function org_classify(data) {
  return request({
    url: '/data/org_classify/json/all',
    method: 'post',
  })
}

export function org_type(data) {
  let url = '/data/org_type/json/all'
  if (data) {
    url = '/data/org_type/json/all/' + data
  }
  return request({
    url: url,
    method: 'post',
  })
}

export function org_quality(data) {
  return request({
    url: '/data/org_quality/json/all',
    method: 'post',
  })
}

export function education_admin_type(data) {
  return request({
    url: '/data/education_admin_type/json/all',
    method: 'post',
  })
}

export function focus_type(data) {
  return request({
    url: '/data/focus_type/json/all',
    method: 'post',
  })
}

export function education_type(data) {
  return request({
    url: '/data/education_type/json/all',
    method: 'post',
  })
}

export function base_infoEdu(data) {
  return request({
    url: '/organization/base_info/edu',
    method: 'post',
  })
}

export function base_infoUpdate(data) {
  return request({
    url: '/organization/base_info/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function fileUpload(data) {
  return request({
    url: '/meta/organization/fileUpload',
    method: 'post',
    data
  })
}

export function filePreview(data) {
  return request({
    url: '/meta/organization/filePath4pdf',
    method: 'post',
  })
}

export function save4org(data) {
  return request({
    url: '/base/save4org',
    method: 'post',
    headers: { 'Content-Type': 'application/json; charset=UTF-8' },
    data
  })
}

export function allData4org(data) {
  return request({
    url: '/base/allData4org',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function base_fileUpload(data) {
  return request({
    url: '/base/fileUpload',
    method: 'post',
    data
  })
}

export function updateBySportId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/updateBySportId',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function updateByCoachId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/updateByCoachId',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function updateByPlayerId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/updateByPlayerId',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function allBySportId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/allBySportId',
    method: 'post',
  })
}

export function allByCoachId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/allByCoachId',
    method: 'post',
  })
}

export function allByPlayerId(data) {
  return request({
    url: '/meta/player_coach_map/proportion/json/allByPlayerId',
    method: 'post',
  })
}

export function pcm4dict(data) {
  return request({
    url: '/meta/player_coach_map/pcm4dict',
    method: 'post',
  })
}

export function ground_all(data) {
  return request({
    url: '/ground/json/all',
    method: 'post',
  })
}

export function ground_select(data) {
  return request({
    url: '/ground/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function ground_insert(data) {
  return request({
    url: '/ground/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function ground_update(data) {
  return request({
    url: '/ground/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function ground_delete(data) {
  return request({
    url: '/ground/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainingFacilities_all(data) {
  return request({
    url: '/asset/trainingFacilities/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainingFacilities_insert(data) {
  return request({
    url: '/asset/trainingFacilities/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainingFacilities_update(data) {
  return request({
    url: '/asset/trainingFacilities/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function trainingFacilities_delete(data) {
  return request({
    url: '/asset/trainingFacilities/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function medicalFacilities_all(data) {
  return request({
    url: '/asset/medicalFacilities/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function medicalFacilities_insert(data) {
  return request({
    url: '/asset/medicalFacilities/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function medicalFacilities_select(data) {
  return request({
    url: '/asset/medicalFacilities/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function medicalFacilities_update(data) {
  return request({
    url: '/asset/medicalFacilities/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function medicalFacilities_delete(data) {
  return request({
    url: '/asset/medicalFacilities/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function userInstrumentRecord_all(data) {
  return request({
    url: '/asset/userInstrumentRecord/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function userInstrumentRecord_select(data) {
  return request({
    url: '/asset/userInstrumentRecord/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function userInstrumentRecord_update(data) {
  return request({
    url: '/asset/userInstrumentRecord/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function userInstrumentRecord_insert(data) {
  return request({
    url: '/asset/userInstrumentRecord/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function userInstrumentRecord_delete(data) {
  return request({
    url: '/asset/userInstrumentRecord/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function educationFacilities_all(data) {
  return request({
    url: '/asset/educationFacilities/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function educationFacilities_select(data) {
  return request({
    url: '/asset/educationFacilities/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function educationFacilities_insert(data) {
  return request({
    url: '/asset/educationFacilities/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function educationFacilities_update(data) {
  return request({
    url: '/asset/educationFacilities/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function educationFacilities_delete(data) {
  return request({
    url: '/asset/educationFacilities/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_all(data) {
  return request({
    url: '/asset/gun/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_insert(data) {
  return request({
    url: '/asset/gun/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_update(data) {
  return request({
    url: '/asset/gun/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_select(data) {
  return request({
    url: '/asset/gun/json/select',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_delete(data) {
  return request({
    url: '/asset/gun/json/delete',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgLicenseSelect(data) {
  return request({
    url: '/asset/gun/orgLicenseSelect',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function orgLicenseUpdate(data) {
  return request({
    url: '/asset/gun/orgLicenseUpdate',
    method: 'post',
    data: qs.stringify(data)
  })
}


//查询大赛数据
export function CompetitionResultList(data) {
  return request({
    url: '/match_data/json/selectByArea',
    method: 'get',
    data: qs.stringify(data)
  })
}

//选中大赛成绩中自己学校的运动员
export function getCompetitionResul(data) {
  return request({
    url: `/match_data/json/addOrgId/${data}`,
    method: 'get',
  })
}


export function deleteAddDataOrg(data) {
  return request({
    url: `/match_data/json/deleteAddDataOrg/${data}`,
    method: 'get',
  })
}

//获取已有数据的所有地区
export function selectAllArea(data) {
  return request({
    url: '/match_data/json/selectAllArea',
    method: 'get',
    data: qs.stringify(data)
  })
}


export function lookallData4org() {
  return request({
    url: '/match_data/json/select',
    method: 'get',

  })
}



export function match_statistics_all(data) {
  return request({
    url: '/match/statistics/default',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function listFiles(data) {
  return request({
    url: '/base/listFiles',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_brand_insert(data) {
  return request({
    url: '/asset/gun_brand/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function gun_store_insert(data) {
  return request({
    url: '/asset/gun_store/json/insert',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function base_check_summary(data) {
  return request({
    url: '/data/base_check_summary/json/all',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function base_check_summary_update(data) {
  return request({
    url: '/data/base_check_summary/json/update',
    method: 'post',
    data: qs.stringify(data)
  })
}

export function fileDownload(data) {
  return request({
    url: '/meta/organization/fileDownload',
    method: 'post',
    responseType: 'blob',
  })
}

export function fileDownloadOSS(name, suffix) {
  return request({
    url: '/base/fileDownloadOSS/0/' + name + '/' + suffix,
    method: 'post',
    responseType: 'blob',
  })
}
